import pymysql
from wrapper.FunWrapper import log


@log
def test(name):
    connect = pymysql.connect(host='localhost', user='root', password='123456', port=3306, database='woniudb')
    cursor = connect.cursor()
    cursor.execute("insert into stu values (0,'{}',10,'男')".format(name))
    connect.commit()
    cursor.close()
    if connect:
        connect.close()
        print('连接已关闭')
    else:
        print('关闭连接失败')
test('王五')